﻿
namespace NetROS.Tiers.Windows.Forms
{
	/// <summary>
	/// abstract ObracunOsobaObustavaNaknada typed datagridview
	/// </summary>
	[System.ComponentModel.DesignerCategoryAttribute("code")]
	public abstract class ObracunOsobaObustavaNaknadaDataGridViewBase : System.Windows.Forms.UserControl
	{	
		/// <summary> 
		/// Thrown when the current Entity changed.
		/// </summary>
		public event System.EventHandler<ObracunOsobaObustavaNaknadaDataGridViewEventArgs> CurrentEntityChanged;
		
		#region Fields
				
		/// <summary> 
		/// the current entity.
		/// </summary>
		private Entities.ObracunOsobaObustavaNaknada _currentObracunOsobaObustavaNaknada = null;
		//private Dictionary<string, string> _columnsHeaders = new Dictionary<string, string>();
		
		/// <summary> 
		/// the datagridview instance
		/// </summary>
		protected System.Windows.Forms.DataGridView uxObracunOsobaObustavaNaknadaDataGridView;
		
		/// <summary> 
		/// the errorprovider
		/// </summary>
		protected System.Windows.Forms.ErrorProvider uxObracunOsobaObustavaNaknadaErrorProvider;
		
		/// <summary> 
		/// the bindingsource
		/// </summary>
		protected System.Windows.Forms.BindingSource uxObracunOsobaObustavaNaknadaBindingSource;
		
		
		/// <summary> 
		/// the DGV column associated with the ID property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxIDDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the PrimateljNaziv property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxPrimateljNazivDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the PrimateljSjediste property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxPrimateljSjedisteDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the OpisPlacanja property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxOpisPlacanjaDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the ZiroRacun property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxZiroRacunDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the Iznos property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxIznosDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the DatumIsplate property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxDatumIsplateDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the Model property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxModelDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the PozivNaBroj property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxPozivNaBrojDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the Napomena property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxNapomenaDataGridViewColumn;
		/// <summary> 
		/// the DGV column associated with the IDObustavaNaknadaTip property
		/// </summary>
		protected System.Windows.Forms.DataGridViewComboBoxColumn uxIDObustavaNaknadaTipDataGridViewColumn;
		/// <summary> 
		/// the DGV column associated with the IDObracunOsoba property
		/// </summary>
		protected System.Windows.Forms.DataGridViewComboBoxColumn uxIDObracunOsobaDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the IDOsobaObustavaNaknada property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxIDOsobaObustavaNaknadaDataGridViewColumn;
		
		#endregion
					
		#region Combo list
		
				
		private Entities.TList<Entities.ObracunOsoba> _IDObracunOsobaList;
		
		/// <summary> 
		/// The list of selectable ObracunOsoba
		/// </summary>
		[System.ComponentModel.Category("DropDownList BindingSources")]
		public Entities.TList<Entities.ObracunOsoba> IDObracunOsobaList
		{
			get {return this._IDObracunOsobaList;}
			set 
			{
				this._IDObracunOsobaList = value;
				this.uxIDObracunOsobaDataGridViewColumn.DataSource = null;
				this.uxIDObracunOsobaDataGridViewColumn.DataSource = this._IDObracunOsobaList;
			}
		}
		
		private bool _allowNewItemInIDObracunOsobaList;
		
		/// <summary> 
		/// Indicates if user can add an item in the list of ObracunOsoba
		/// </summary>
		[System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Indicates if end user can add a new item in the combobox. an event will be thrown then.")]
		public bool AllowNewItemInIDObracunOsobaList
		{
			get { return _allowNewItemInIDObracunOsobaList;}
			set
			{
				this._allowNewItemInIDObracunOsobaList = value;
				this.uxIDObracunOsobaDataGridViewColumn.DisplayStyle = value ? System.Windows.Forms.DataGridViewComboBoxDisplayStyle.ComboBox : System.Windows.Forms.DataGridViewComboBoxDisplayStyle.DropDownButton;
			}
		}
		
				
		private Entities.TList<Entities.ObustavaNaknadaTip> _IDObustavaNaknadaTipList;
		
		/// <summary> 
		/// The list of selectable ObustavaNaknadaTip
		/// </summary>
		[System.ComponentModel.Category("DropDownList BindingSources")]
		public Entities.TList<Entities.ObustavaNaknadaTip> IDObustavaNaknadaTipList
		{
			get {return this._IDObustavaNaknadaTipList;}
			set 
			{
				this._IDObustavaNaknadaTipList = value;
				this.uxIDObustavaNaknadaTipDataGridViewColumn.DataSource = null;
				this.uxIDObustavaNaknadaTipDataGridViewColumn.DataSource = this._IDObustavaNaknadaTipList;
			}
		}
		
		private bool _allowNewItemInIDObustavaNaknadaTipList;
		
		/// <summary> 
		/// Indicates if user can add an item in the list of ObustavaNaknadaTip
		/// </summary>
		[System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Indicates if end user can add a new item in the combobox. an event will be thrown then.")]
		public bool AllowNewItemInIDObustavaNaknadaTipList
		{
			get { return _allowNewItemInIDObustavaNaknadaTipList;}
			set
			{
				this._allowNewItemInIDObustavaNaknadaTipList = value;
				this.uxIDObustavaNaknadaTipDataGridViewColumn.DisplayStyle = value ? System.Windows.Forms.DataGridViewComboBoxDisplayStyle.ComboBox : System.Windows.Forms.DataGridViewComboBoxDisplayStyle.DropDownButton;
			}
		}
		
		#endregion
		
		#region Main Datasource
		
		private Entities.TList<Entities.ObracunOsobaObustavaNaknada> _ObracunOsobaObustavaNaknadaList;
				
		/// <summary> 
		/// The list of ObracunOsobaObustavaNaknada to be displayed in the DGV.
		/// </summary>
		[System.ComponentModel.Category("Data")]
		public Entities.TList<Entities.ObracunOsobaObustavaNaknada> ObracunOsobaObustavaNaknadaList
		{
			get {return this._ObracunOsobaObustavaNaknadaList;}
			set
			{
				this._ObracunOsobaObustavaNaknadaList = value;
				this.uxObracunOsobaObustavaNaknadaBindingSource.DataSource = null;
				this.uxObracunOsobaObustavaNaknadaBindingSource.DataSource = value;
				this.uxObracunOsobaObustavaNaknadaDataGridView.DataSource = null;
				this.uxObracunOsobaObustavaNaknadaDataGridView.DataSource = this.uxObracunOsobaObustavaNaknadaBindingSource;				
				//this.uxObracunOsobaObustavaNaknadaBindingSource.ListChanged += new System.ComponentModel.ListChangedEventHandler(uxObracunOsobaObustavaNaknadaBindingSource_ListChanged);
				this.uxObracunOsobaObustavaNaknadaBindingSource.CurrentItemChanged += new System.EventHandler(OnObracunOsobaObustavaNaknadaBindingSourceCurrentItemChanged);
			}
		}
		
		private void OnObracunOsobaObustavaNaknadaBindingSourceCurrentItemChanged(object sender, System.EventArgs e)
		{
			_currentObracunOsobaObustavaNaknada = uxObracunOsobaObustavaNaknadaBindingSource.Current as Entities.ObracunOsobaObustavaNaknada;
			
			if (_currentObracunOsobaObustavaNaknada != null)
			{
				_currentObracunOsobaObustavaNaknada.Validate();
			}
			//_ObracunOsobaObustavaNaknada.Validate();
			OnCurrentEntityChanged();
		}

		//void uxObracunOsobaObustavaNaknadaBindingSource_ListChanged(object sender, System.ComponentModel.ListChangedEventArgs e)
		//{
			//throw new Exception("The method or operation is not implemented.");
		//}		
		
		#endregion
		
		/// <summary>
		/// Gets the currently selected <c cref="Entities.ObracunOsobaObustavaNaknada"/> instance.
		/// </summary>
		public Entities.ObracunOsobaObustavaNaknada SelectedObracunOsobaObustavaNaknada
		{
			get {return this._currentObracunOsobaObustavaNaknada;}
		}
		
		#region other properties
		
		/// <summary>
		/// Gets or sets a value indicating whether you have provided your own data-management operations for the DataGridView control.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]
		public bool VirtualMode
		{
			get {return this.uxObracunOsobaObustavaNaknadaDataGridView.VirtualMode;}
			set
			{
				this.uxObracunOsobaObustavaNaknadaDataGridView.VirtualMode = value;
			}
		}
		
		/// <summary>
		/// Gets or sets a value indicating whether the option to add rows is displayed to the user.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]
		public bool AllowUserToAddRows
		{
			get {return this.uxObracunOsobaObustavaNaknadaDataGridView.AllowUserToAddRows;}
			set {this.uxObracunOsobaObustavaNaknadaDataGridView.AllowUserToAddRows = value;}
		}
		
		/// <summary>
		/// Gets or sets a value indicating whether the user is allowed to delete rows from the DataGridView.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]
		public bool AllowUserToDeleteRows
		{
			get {return this.uxObracunOsobaObustavaNaknadaDataGridView.AllowUserToDeleteRows;}
			set {this.uxObracunOsobaObustavaNaknadaDataGridView.AllowUserToDeleteRows = value;}
		}
		
		/// <summary>
		/// Gets the <c cref="DataGridView"/> instance.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]
		public System.Windows.Forms.DataGridView DataGridView
		{
			get {return this.uxObracunOsobaObustavaNaknadaDataGridView;}
		}
		
		/// <summary>
		/// Gets a collection that contains all the columns in the control.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]		
		[System.ComponentModel.DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Visible)]
		//[System.ComponentModel.EditorAttribute("System.Windows.Forms.Design.DataGridViewColumnCollectionEditor, System.Design", typeof(System.Drawing.Design.UITypeEditor))] 
		public System.Windows.Forms.DataGridViewColumnCollection Columns
		{
			get { return this.uxObracunOsobaObustavaNaknadaDataGridView.Columns; }
		}
		
		#endregion
		
		/// <summary> 
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.IContainer components = null;
	
		/// <summary> 
		/// Clean up any resources being used.
		/// </summary>
		/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
		protected override void Dispose(bool disposing)
		{
			if (disposing && (components != null))
			{
				components.Dispose();
			}
			base.Dispose(disposing);
		}
	
		#region Constructor
	
		/// <summary>
		/// Initializes a new instance of the <see cref="ObracunOsobaObustavaNaknadaDataGridViewBase"/> class.
		/// </summary>
		public ObracunOsobaObustavaNaknadaDataGridViewBase()
		{			
			this.components = new System.ComponentModel.Container();			
			
			this.uxObracunOsobaObustavaNaknadaDataGridView = new System.Windows.Forms.DataGridView();
			this.uxObracunOsobaObustavaNaknadaBindingSource = new System.Windows.Forms.BindingSource(this.components);
			this.uxObracunOsobaObustavaNaknadaErrorProvider = new System.Windows.Forms.ErrorProvider(this.components);
			this.uxIDDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxPrimateljNazivDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxPrimateljSjedisteDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxOpisPlacanjaDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxZiroRacunDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxIznosDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxDatumIsplateDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxModelDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxPozivNaBrojDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxNapomenaDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxIDObustavaNaknadaTipDataGridViewColumn = new System.Windows.Forms.DataGridViewComboBoxColumn();
			this.uxIDObracunOsobaDataGridViewColumn = new System.Windows.Forms.DataGridViewComboBoxColumn();
			this.uxIDOsobaObustavaNaknadaDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			//this.uxIDObracunOsobaBindingSource = new ObracunOsobaBindingSource(this.components);
			//((System.ComponentModel.ISupportInitialize)(this.uxIDObracunOsobaBindingSource)).BeginInit();
			//this.uxIDObustavaNaknadaTipBindingSource = new ObustavaNaknadaTipBindingSource(this.components);
			//((System.ComponentModel.ISupportInitialize)(this.uxIDObustavaNaknadaTipBindingSource)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.uxObracunOsobaObustavaNaknadaDataGridView)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.uxObracunOsobaObustavaNaknadaBindingSource)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.uxObracunOsobaObustavaNaknadaErrorProvider)).BeginInit();
			this.SuspendLayout();
						
			// 
			// uxObracunOsobaObustavaNaknadaErrorProvider
			// 
			this.uxObracunOsobaObustavaNaknadaErrorProvider.ContainerControl = this;
			this.uxObracunOsobaObustavaNaknadaErrorProvider.DataSource = this.uxObracunOsobaObustavaNaknadaBindingSource;						
			// 
			// uxObracunOsobaObustavaNaknadaDataGridView
			// 
			this.uxObracunOsobaObustavaNaknadaDataGridView.AutoGenerateColumns = false;
			this.uxObracunOsobaObustavaNaknadaDataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
			this.uxObracunOsobaObustavaNaknadaDataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
		this.uxIDDataGridViewColumn,
		this.uxPrimateljNazivDataGridViewColumn,
		this.uxPrimateljSjedisteDataGridViewColumn,
		this.uxOpisPlacanjaDataGridViewColumn,
		this.uxZiroRacunDataGridViewColumn,
		this.uxIznosDataGridViewColumn,
		this.uxDatumIsplateDataGridViewColumn,
		this.uxModelDataGridViewColumn,
		this.uxPozivNaBrojDataGridViewColumn,
		this.uxNapomenaDataGridViewColumn,
		this.uxIDObustavaNaknadaTipDataGridViewColumn,
		this.uxIDObracunOsobaDataGridViewColumn,
		this.uxIDOsobaObustavaNaknadaDataGridViewColumn			});
			this.uxObracunOsobaObustavaNaknadaDataGridView.Dock = System.Windows.Forms.DockStyle.Fill;
			this.uxObracunOsobaObustavaNaknadaDataGridView.Location = new System.Drawing.Point(0, 0);
			this.uxObracunOsobaObustavaNaknadaDataGridView.Name = "uxObracunOsobaObustavaNaknadaDataGridView";
			this.uxObracunOsobaObustavaNaknadaDataGridView.Size = new System.Drawing.Size(470, 300);
			this.uxObracunOsobaObustavaNaknadaDataGridView.TabIndex = 0;	
			this.uxObracunOsobaObustavaNaknadaDataGridView.BackgroundColor = System.Drawing.Color.WhiteSmoke;
			this.uxObracunOsobaObustavaNaknadaDataGridView.EnableHeadersVisualStyles = false;
			this.uxObracunOsobaObustavaNaknadaDataGridView.DataError += new System.Windows.Forms.DataGridViewDataErrorEventHandler(this.OnObracunOsobaObustavaNaknadaDataGridViewDataError);
			this.uxObracunOsobaObustavaNaknadaDataGridView.CellValueNeeded += new System.Windows.Forms.DataGridViewCellValueEventHandler(this.OnObracunOsobaObustavaNaknadaDataGridViewCellValueNeeded);
			this.uxObracunOsobaObustavaNaknadaDataGridView.CellValuePushed += new System.Windows.Forms.DataGridViewCellValueEventHandler(this.OnObracunOsobaObustavaNaknadaDataGridViewCellValuePushed);
			
			//
			// uxIDDataGridViewColumn
			//
			this.uxIDDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxIDDataGridViewColumn.DataPropertyName = "ID";
			this.uxIDDataGridViewColumn.HeaderText = "ID";
			this.uxIDDataGridViewColumn.Name = "uxIDDataGridViewColumn";
			this.uxIDDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxIDDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxIDDataGridViewColumn.ReadOnly = true;		
			//
			// uxPrimateljNazivDataGridViewColumn
			//
			this.uxPrimateljNazivDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxPrimateljNazivDataGridViewColumn.DataPropertyName = "PrimateljNaziv";
			this.uxPrimateljNazivDataGridViewColumn.HeaderText = "PrimateljNaziv";
			this.uxPrimateljNazivDataGridViewColumn.Name = "uxPrimateljNazivDataGridViewColumn";
			this.uxPrimateljNazivDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxPrimateljNazivDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxPrimateljNazivDataGridViewColumn.ReadOnly = false;		
			//
			// uxPrimateljSjedisteDataGridViewColumn
			//
			this.uxPrimateljSjedisteDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxPrimateljSjedisteDataGridViewColumn.DataPropertyName = "PrimateljSjediste";
			this.uxPrimateljSjedisteDataGridViewColumn.HeaderText = "PrimateljSjediste";
			this.uxPrimateljSjedisteDataGridViewColumn.Name = "uxPrimateljSjedisteDataGridViewColumn";
			this.uxPrimateljSjedisteDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxPrimateljSjedisteDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxPrimateljSjedisteDataGridViewColumn.ReadOnly = false;		
			//
			// uxOpisPlacanjaDataGridViewColumn
			//
			this.uxOpisPlacanjaDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxOpisPlacanjaDataGridViewColumn.DataPropertyName = "OpisPlacanja";
			this.uxOpisPlacanjaDataGridViewColumn.HeaderText = "OpisPlacanja";
			this.uxOpisPlacanjaDataGridViewColumn.Name = "uxOpisPlacanjaDataGridViewColumn";
			this.uxOpisPlacanjaDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxOpisPlacanjaDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxOpisPlacanjaDataGridViewColumn.ReadOnly = false;		
			//
			// uxZiroRacunDataGridViewColumn
			//
			this.uxZiroRacunDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxZiroRacunDataGridViewColumn.DataPropertyName = "ZiroRacun";
			this.uxZiroRacunDataGridViewColumn.HeaderText = "ZiroRacun";
			this.uxZiroRacunDataGridViewColumn.Name = "uxZiroRacunDataGridViewColumn";
			this.uxZiroRacunDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxZiroRacunDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxZiroRacunDataGridViewColumn.ReadOnly = false;		
			//
			// uxIznosDataGridViewColumn
			//
			this.uxIznosDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxIznosDataGridViewColumn.DataPropertyName = "Iznos";
			this.uxIznosDataGridViewColumn.HeaderText = "Iznos";
			this.uxIznosDataGridViewColumn.Name = "uxIznosDataGridViewColumn";
			this.uxIznosDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxIznosDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxIznosDataGridViewColumn.ReadOnly = false;		
			//
			// uxDatumIsplateDataGridViewColumn
			//
			this.uxDatumIsplateDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxDatumIsplateDataGridViewColumn.DataPropertyName = "DatumIsplate";
			this.uxDatumIsplateDataGridViewColumn.HeaderText = "DatumIsplate";
			this.uxDatumIsplateDataGridViewColumn.Name = "uxDatumIsplateDataGridViewColumn";
			this.uxDatumIsplateDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxDatumIsplateDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxDatumIsplateDataGridViewColumn.ReadOnly = false;		
			//
			// uxModelDataGridViewColumn
			//
			this.uxModelDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxModelDataGridViewColumn.DataPropertyName = "Model";
			this.uxModelDataGridViewColumn.HeaderText = "Model";
			this.uxModelDataGridViewColumn.Name = "uxModelDataGridViewColumn";
			this.uxModelDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxModelDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxModelDataGridViewColumn.ReadOnly = false;		
			//
			// uxPozivNaBrojDataGridViewColumn
			//
			this.uxPozivNaBrojDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxPozivNaBrojDataGridViewColumn.DataPropertyName = "PozivNaBroj";
			this.uxPozivNaBrojDataGridViewColumn.HeaderText = "PozivNaBroj";
			this.uxPozivNaBrojDataGridViewColumn.Name = "uxPozivNaBrojDataGridViewColumn";
			this.uxPozivNaBrojDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxPozivNaBrojDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxPozivNaBrojDataGridViewColumn.ReadOnly = false;		
			//
			// uxNapomenaDataGridViewColumn
			//
			this.uxNapomenaDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxNapomenaDataGridViewColumn.DataPropertyName = "Napomena";
			this.uxNapomenaDataGridViewColumn.HeaderText = "Napomena";
			this.uxNapomenaDataGridViewColumn.Name = "uxNapomenaDataGridViewColumn";
			this.uxNapomenaDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxNapomenaDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxNapomenaDataGridViewColumn.ReadOnly = false;		
			//
			// uxIDObustavaNaknadaTipDataGridViewColumn
			//
			this.uxIDObustavaNaknadaTipDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxIDObustavaNaknadaTipDataGridViewColumn.DataPropertyName = "IDObustavaNaknadaTip";
			this.uxIDObustavaNaknadaTipDataGridViewColumn.HeaderText = "IDObustavaNaknadaTip";
			this.uxIDObustavaNaknadaTipDataGridViewColumn.Name = "uxIDObustavaNaknadaTipDataGridViewColumn";
			this.uxIDObustavaNaknadaTipDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxIDObustavaNaknadaTipDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxIDObustavaNaknadaTipDataGridViewColumn.ReadOnly = false;		
			//
			// uxIDObracunOsobaDataGridViewColumn
			//
			this.uxIDObracunOsobaDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxIDObracunOsobaDataGridViewColumn.DataPropertyName = "IDObracunOsoba";
			this.uxIDObracunOsobaDataGridViewColumn.HeaderText = "IDObracunOsoba";
			this.uxIDObracunOsobaDataGridViewColumn.Name = "uxIDObracunOsobaDataGridViewColumn";
			this.uxIDObracunOsobaDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxIDObracunOsobaDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxIDObracunOsobaDataGridViewColumn.ReadOnly = false;		
			//
			// uxIDOsobaObustavaNaknadaDataGridViewColumn
			//
			this.uxIDOsobaObustavaNaknadaDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxIDOsobaObustavaNaknadaDataGridViewColumn.DataPropertyName = "IDOsobaObustavaNaknada";
			this.uxIDOsobaObustavaNaknadaDataGridViewColumn.HeaderText = "IDOsobaObustavaNaknada";
			this.uxIDOsobaObustavaNaknadaDataGridViewColumn.Name = "uxIDOsobaObustavaNaknadaDataGridViewColumn";
			this.uxIDOsobaObustavaNaknadaDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxIDOsobaObustavaNaknadaDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxIDOsobaObustavaNaknadaDataGridViewColumn.ReadOnly = false;		
			//
			// uxIDObracunOsobaDataGridViewColumn
			//				
			this.uxIDObracunOsobaDataGridViewColumn.DisplayMember = "IDOsoba";	
			this.uxIDObracunOsobaDataGridViewColumn.ValueMember = "ID";	
			this.uxIDObracunOsobaDataGridViewColumn.DisplayStyleForCurrentCellOnly = true;
			//uxIDObracunOsobaDataGridViewColumn.DataSource = uxIDObracunOsobaBindingSource;				
				
			//
			// uxIDObustavaNaknadaTipDataGridViewColumn
			//				
			this.uxIDObustavaNaknadaTipDataGridViewColumn.DisplayMember = "Naziv";	
			this.uxIDObustavaNaknadaTipDataGridViewColumn.ValueMember = "ID";	
			this.uxIDObustavaNaknadaTipDataGridViewColumn.DisplayStyleForCurrentCellOnly = true;
			//uxIDObustavaNaknadaTipDataGridViewColumn.DataSource = uxIDObustavaNaknadaTipBindingSource;				
				
			
			// this
			this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
			this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
			this.Controls.Add(this.uxObracunOsobaObustavaNaknadaDataGridView);
			this.Name = "ObracunOsobaObustavaNaknadaDataGridView";
			this.Size = new System.Drawing.Size(470, 300);
			//((System.ComponentModel.ISupportInitialize)(this.uxIDObracunOsobaBindingSource)).EndInit();
			//((System.ComponentModel.ISupportInitialize)(this.uxIDObustavaNaknadaTipBindingSource)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.uxObracunOsobaObustavaNaknadaErrorProvider)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.uxObracunOsobaObustavaNaknadaDataGridView)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.uxObracunOsobaObustavaNaknadaBindingSource)).EndInit();
			this.ResumeLayout(false);
		}
		#endregion
				
		#region events
		
		/// <summary>
		/// Raised the CurrentEntityChanged event.
		/// </summary>
		protected void OnCurrentEntityChanged()
		{
			if (CurrentEntityChanged != null)
			{
				ObracunOsobaObustavaNaknadaDataGridViewEventArgs args = new ObracunOsobaObustavaNaknadaDataGridViewEventArgs();
				args.ObracunOsobaObustavaNaknada = _currentObracunOsobaObustavaNaknada;
				CurrentEntityChanged(this, args); 
			}
		}
		
		#endregion
		
		/// <summary>
		/// Strongly typed event 
		/// </summary>
		public class ObracunOsobaObustavaNaknadaDataGridViewEventArgs : System.EventArgs
		{
			private Entities.ObracunOsobaObustavaNaknada	_ObracunOsobaObustavaNaknada;
	
			/// <summary>
			/// the  Entities.ObracunOsobaObustavaNaknada instance.
			/// </summary>
			public Entities.ObracunOsobaObustavaNaknada ObracunOsobaObustavaNaknada
			{
				get { return _ObracunOsobaObustavaNaknada; }
				set { _ObracunOsobaObustavaNaknada = value; }
			}	
		}
		
		/// <summary>
		/// Handles the DataError event of the uxObracunOsobaObustavaNaknadaDataGridView control.
		/// </summary>
		/// <param name="sender">The source of the event.</param>
		/// <param name="e">The <see cref="T:System.Windows.Forms.DataGridViewDataErrorEventArgs"/> instance containing the event data.</param>
		protected void OnObracunOsobaObustavaNaknadaDataGridViewDataError(object sender, System.Windows.Forms.DataGridViewDataErrorEventArgs e)
		{
			System.Diagnostics.Debug.WriteLine(string.Format( "{0}, {1}", e.ColumnIndex, e.RowIndex));
		}
		
		/// <summary>
		/// Handles the CellValueNeeded event of the uxObracunOsobaObustavaNaknadaDataGridView control.
		/// </summary>
		/// <param name="sender">The source of the event.</param>
		/// <param name="e">The <see cref="T:System.Windows.Forms.DataGridViewCellValueEventArgs"/> instance containing the event data.</param>
		protected void OnObracunOsobaObustavaNaknadaDataGridViewCellValueNeeded(object sender, System.Windows.Forms.DataGridViewCellValueEventArgs e)
		{
			switch(uxObracunOsobaObustavaNaknadaDataGridView.Columns[e.ColumnIndex].Name)
			{
					case "uxIDDataGridViewColumn":
						e.Value = ObracunOsobaObustavaNaknadaList[e.RowIndex].ID;
						break;
					case "uxPrimateljNazivDataGridViewColumn":
						e.Value = ObracunOsobaObustavaNaknadaList[e.RowIndex].PrimateljNaziv;
						break;
					case "uxPrimateljSjedisteDataGridViewColumn":
						e.Value = ObracunOsobaObustavaNaknadaList[e.RowIndex].PrimateljSjediste;
						break;
					case "uxOpisPlacanjaDataGridViewColumn":
						e.Value = ObracunOsobaObustavaNaknadaList[e.RowIndex].OpisPlacanja;
						break;
					case "uxZiroRacunDataGridViewColumn":
						e.Value = ObracunOsobaObustavaNaknadaList[e.RowIndex].ZiroRacun;
						break;
					case "uxIznosDataGridViewColumn":
						e.Value = ObracunOsobaObustavaNaknadaList[e.RowIndex].Iznos;
						break;
					case "uxDatumIsplateDataGridViewColumn":
						e.Value = ObracunOsobaObustavaNaknadaList[e.RowIndex].DatumIsplate;
						break;
					case "uxModelDataGridViewColumn":
						e.Value = ObracunOsobaObustavaNaknadaList[e.RowIndex].Model;
						break;
					case "uxPozivNaBrojDataGridViewColumn":
						e.Value = ObracunOsobaObustavaNaknadaList[e.RowIndex].PozivNaBroj;
						break;
					case "uxNapomenaDataGridViewColumn":
						e.Value = ObracunOsobaObustavaNaknadaList[e.RowIndex].Napomena;
						break;
					case "uxIDObustavaNaknadaTipDataGridViewColumn":
						e.Value = ObracunOsobaObustavaNaknadaList[e.RowIndex].IDObustavaNaknadaTip;
						break;
					case "uxIDObracunOsobaDataGridViewColumn":
						e.Value = ObracunOsobaObustavaNaknadaList[e.RowIndex].IDObracunOsoba;
						break;
					case "uxIDOsobaObustavaNaknadaDataGridViewColumn":
						e.Value = ObracunOsobaObustavaNaknadaList[e.RowIndex].IDOsobaObustavaNaknada;
						break;
				default:
				break;
			}
		}
		
		/// <summary>
		/// Handles the CellValuePushed event of the uxObracunOsobaObustavaNaknadaDataGridView control.
		/// </summary>
		/// <param name="sender">The source of the event.</param>
		/// <param name="e">The <see cref="T:System.Windows.Forms.DataGridViewCellValueEventArgs"/> instance containing the event data.</param>
		protected void OnObracunOsobaObustavaNaknadaDataGridViewCellValuePushed(object sender, System.Windows.Forms.DataGridViewCellValueEventArgs e)
		{
			switch(uxObracunOsobaObustavaNaknadaDataGridView.Columns[e.ColumnIndex].Name)
			{
					case "uxIDDataGridViewColumn":
						ObracunOsobaObustavaNaknadaList[e.RowIndex].ID = (System.Int32)e.Value;
						break;
					case "uxPrimateljNazivDataGridViewColumn":
						ObracunOsobaObustavaNaknadaList[e.RowIndex].PrimateljNaziv = (System.String)e.Value;
						break;
					case "uxPrimateljSjedisteDataGridViewColumn":
						ObracunOsobaObustavaNaknadaList[e.RowIndex].PrimateljSjediste = (System.String)e.Value;
						break;
					case "uxOpisPlacanjaDataGridViewColumn":
						ObracunOsobaObustavaNaknadaList[e.RowIndex].OpisPlacanja = (System.String)e.Value;
						break;
					case "uxZiroRacunDataGridViewColumn":
						ObracunOsobaObustavaNaknadaList[e.RowIndex].ZiroRacun = (System.String)e.Value;
						break;
					case "uxIznosDataGridViewColumn":
						ObracunOsobaObustavaNaknadaList[e.RowIndex].Iznos = (System.Decimal)e.Value;
						break;
					case "uxDatumIsplateDataGridViewColumn":
						ObracunOsobaObustavaNaknadaList[e.RowIndex].DatumIsplate = (System.DateTime)e.Value;
						break;
					case "uxModelDataGridViewColumn":
						ObracunOsobaObustavaNaknadaList[e.RowIndex].Model = (System.String)e.Value;
						break;
					case "uxPozivNaBrojDataGridViewColumn":
						ObracunOsobaObustavaNaknadaList[e.RowIndex].PozivNaBroj = (System.String)e.Value;
						break;
					case "uxNapomenaDataGridViewColumn":
						ObracunOsobaObustavaNaknadaList[e.RowIndex].Napomena = (System.String)e.Value;
						break;
					case "uxIDObustavaNaknadaTipDataGridViewColumn":
						ObracunOsobaObustavaNaknadaList[e.RowIndex].IDObustavaNaknadaTip = (System.Int32)e.Value;
						break;
					case "uxIDObracunOsobaDataGridViewColumn":
						ObracunOsobaObustavaNaknadaList[e.RowIndex].IDObracunOsoba = (System.Int32)e.Value;
						break;
					case "uxIDOsobaObustavaNaknadaDataGridViewColumn":
						ObracunOsobaObustavaNaknadaList[e.RowIndex].IDOsobaObustavaNaknada = (System.Int32?)e.Value;
						break;
				default:
				break;
			}
		}
	}
}
